'use strict';
const bcrypt = require('bcrypt')

/** @type {import('sequelize-cli').Migration} */
module.exports = {
	async up(queryInterface, Sequelize) {
		/**
		 * Add seed commands here.
		 *
		 * Example:
		 * await queryInterface.bulkInsert('People', [{
		 *   name: 'John Doe',
		 *   isBetaMember: false
		 * }], {});
		 */
		await queryInterface.bulkInsert('Users', [
			{
				email: 'aaaa@163.com',
				username: 'aaaa',
				password: bcrypt.hashSync('a11111111', 10),
				nickname: '超管',
				role: 100,
				sex: 2,
				createdAt: new Date(),
				updatedAt: new Date()
			},{
				email: 'bbbb@163.com',
				username: 'bbbb',
				password: bcrypt.hashSync('b11111111', 10),
				nickname: '用户',
				role: 0,
				sex: 2,
				createdAt: new Date(),
				updatedAt: new Date()
			},{
				email: 'cccc@163.com',
				username: 'cccc',
				password: bcrypt.hashSync('c11111111', 10),
				nickname: '用户',
				role: 0,
				sex: 1,
				createdAt: new Date(),
				updatedAt: new Date()
			}
		])
	},

	async down(queryInterface, Sequelize) {
		/**
		 * Add commands to revert seed here.
		 *
		 * Example:
		 * await queryInterface.bulkDelete('People', null, {});
		 */
	}
};